<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Transform overview | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'transform-overview.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/transform-overview.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/transform-overview.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/transform-overview.html" rel="nofollow" target="_blank">../en/transform-overview.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="data-rollup-transform.html">Roll up or transform your data</a></span>
»
<span class="breadcrumb-link"><a href="transforms.html">Transforming data</a></span>
»
<span class="breadcrumb-node">Transform overview</span>
</div>
<div class="navheader">
<span class="prev">
<a href="transforms.html">« Transforming data</a>
</span>
<span class="next">
<a href="transform-setup.html">Set up transforms »</a>
</span>
</div>
<div class="section xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="transform-overview"></a>Transform overview<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/transform/overview.asciidoc">edit</a><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</h2>
</div></div></div>

<p>You can use transforms to <em>pivot</em> your data into a new entity-centric index.
By transforming and summarizing your data, it becomes possible to visualize and
analyze it in alternative and interesting ways.</p>
<p>A lot of Elasticsearch indices are organized as a stream of events: each event is an
individual document, for example a single item purchase. Transforms enable
you to summarize this data, bringing it into an organized, more
analysis-friendly format. For example, you can summarize all the purchases of a
single customer.</p>
<p>Transforms enable you to define a pivot, which is a set of
features that transform the index into a different, more digestible format.
Pivoting results in a summary of your data in a new index.</p>
<p>To define a pivot, first you select one or more fields that you will use to
group your data. You can select categorical fields (terms) and numerical fields
for grouping. If you use numerical fields, the field values are bucketed using
an interval that you specify.</p>
<p>The second step is deciding how you want to aggregate the grouped data. When
using aggregations, you practically ask questions about the index. There are
different types of aggregations, each with its own purpose and output. To learn
more about the supported aggregations and group-by fields, see
<a class="xref" href="put-transform.html" title="Create transform API">Create transform</a>.</p>
<p>As an optional step, you can also add a query to further limit the scope of the
aggregation.</p>
<p>The transform performs a composite aggregation that paginates through all the
data defined by the source index query. The output of the aggregation is stored
in a <em>destination index</em>. Each time the transform queries the source index, it
creates a <em>checkpoint</em>. You can decide whether you want the transform to run
once or continuously. A <em>batch transform</em> is a single operation that has a
single checkpoint. <em>Continuous transforms</em> continually increment and process
checkpoints as new source data is ingested.</p>
<p>Imagine that you run a webshop that sells clothes. Every order creates a
document that contains a unique order ID, the name and the category of the
ordered product, its price, the ordered quantity, the exact date of the order,
and some customer information (name, gender, location, etc). Your dataset
contains all the transactions from last year.</p>
<p>If you want to check the sales in the different categories in your last fiscal
year, define a transform that groups the data by the product categories
(women’s shoes, men’s clothing, etc.) and the order date. Use the last year as
the interval for the order date. Then add a sum aggregation on the ordered
quantity. The result is an entity-centric index that shows the number of sold
items in every product category in the last year.</p>
<div class="imageblock screenshot">
<div class="content">
<img src="../static/images/pivot-preview.jpg" alt="Example of a transform pivot in Kibana">
</div>
</div>
<div class="important admon">
<div class="icon"></div>
<div class="admon_content">
<p>The transform leaves your source index intact. It
creates a new index that is dedicated to the transformed data.</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="transform-performance"></a>Performance considerations<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/transform/overview.asciidoc">edit</a>
</h3>
</div></div></div>
<p>Transforms perform search aggregations on the source indices then index
the results into the destination index. Therefore, a transform never takes
less time or uses less resources than the aggregation and indexing processes.</p>
<p>If your transform must process a lot of historic data, it has high resource
usage initially—​particularly during the first checkpoint.</p>
<p>For better performance, make sure that your search aggregations and queries are
optimized and that your transform is processing only necessary data.</p>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="transforms.html">« Transforming data</a>
</span>
<span class="next">
<a href="transform-setup.html">Set up transforms »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>